﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Test2
{
    //2、根据图片，写出四个英雄和他们的父类，需要有输出数据的方法，需要有构造方法。*/
    class Program2
    {
        static void Main(string[] args)
        {
            Hero aiLuoKe = new AiLuoKe("axel");
            Hero taiLa = new TaiLa("rose");
            Hero luKaSi = new LuKaSi("sally");
            Hero luoFei = new LuoFei("john");
            aiLuoKe.SayHi();
            taiLa.SayHi();
            luKaSi.SayHi();
            luoFei.SayHi();
        }
    }
    interface IHero
    {
        void skill1();
        void skill2();
        void skill3();
        void HeroInfo();
        void SayHi();
    }

    abstract class Hero : IHero
    {
        private int _ATK;
        private int _DEF;
        private int _Speed;
        private string _nickName;
        public int ATK { get => _ATK; set => _ATK = value; }
        public int DEF { get => _DEF; set => _DEF = value; }
        public int Speed { get => _Speed; set => _Speed = value; }
        public string NickName { get => _nickName; set => _nickName = value; }

        public Hero()
        {

        }

        public Hero(string nickNmae)
        {
            this.NickName = nickNmae;
        }

        public abstract void HeroInfo();

        public void SayHi()
        {
            HeroInfo();
            Console.WriteLine($"my ATK is {ATK}," +
                $"my DEF is {DEF},my speed is {Speed},my user nickname is {NickName}");
            skill1();
            skill2();
            skill3();
        }

        public abstract void skill1();
        public abstract void skill2();
        public abstract void skill3();
    }

    class AiLuoKe : Hero
    {
        public const string HERONAME = "艾洛克";
        public override void HeroInfo()
        {
            Console.WriteLine($"my heroname is {HERONAME}");
        }

        public AiLuoKe(string nickName) : base(nickName)
        {
            ATK = 10;
            DEF = 20;
            Speed = 30;
        }

        public AiLuoKe() : this("default")
        {

        }

        public override void skill1()
        {
            Console.WriteLine("碎石打击");
        }

        public override void skill2()
        {
            Console.WriteLine("烈焰锚钩");
        }

        public override void skill3()
        {
            Console.WriteLine("战斗咆哮");
        }
    }
    class TaiLa : Hero
    {
        public const string HERONAME = "泰拉";
        public override void HeroInfo()
        {
            Console.WriteLine($"my heroname is {HERONAME}");
        }

        public TaiLa(string nickName) : base(nickName)
        {
            ATK = 30;
            DEF = 20;
            Speed = 10;
        }

        public TaiLa() : this("default")
        {

        }

        public override void skill1()
        {
            Console.WriteLine("巨浪冲击");
        }

        public override void skill2()
        {
            Console.WriteLine("元素突击");
        }

        public override void skill3()
        {
            Console.WriteLine("复仇杀戮");
        }
    }

    class LuKaSi : Hero
    {
        public const string HERONAME = "卢卡斯";
        public override void HeroInfo()
        {
            Console.WriteLine($"my heroname is {HERONAME}");
        }

        public LuKaSi(string nickName) : base(nickName)
        {
            ATK = 40;
            DEF = 20;
            Speed = 5;
        }

        public LuKaSi() : this("default")
        {

        }

        public override void skill1()
        {
            Console.WriteLine("减速陷阱");
        }

        public override void skill2()
        {
            Console.WriteLine("能量浪潮");
        }

        public override void skill3()
        {
            Console.WriteLine("旋风剑舞");
        }
    }

    class LuoFei : Hero
    {
        public const string HERONAME = "落飞";
        public override void HeroInfo()
        {
            Console.WriteLine($"my heroname is {HERONAME}");
        }

        public LuoFei(string nickName) : base(nickName)
        {
            ATK = 40;
            DEF = 10;
            Speed = 20;
        }

        public LuoFei() : this("default")
        {

        }

        public override void skill1()
        {
            Console.WriteLine("能量精灵");
        }

        public override void skill2()
        {
            Console.WriteLine("暗影传送");
        }

        public override void skill3()
        {
            Console.WriteLine("时空迸裂");
        }
    }

}
